package com.codedef.diary.util;

import android.util.Log;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.codedef.diary.domain.Diary;
import com.codedef.diary.domain.User;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class UserUtil {

    public static User getUserByJson(String json) {
        JSONObject object = JSON.parseObject(json);
        User user = new User();
        user.setId((Integer) object.get("id"));
        user.setBirthday((String) object.get("birthday"));
        user.setGender((Integer) object.get("gender"));
        user.setProfilePicture((String) object.get("ProfilePicture"));
        user.setUsername((String) object.get("username"));
        return user;
    }

}
